﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Register : Form
    {
        public Register()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
        private readonly Dictionary<string, string> _user = new Dictionary<string, string>();
            private void Register_Load(object sender, EventArgs e)
        {
            //  HelpButton = true;
            //MinimizeBox = false;
            //MaximizeBox = false;
            //  _user.Add("admin", "123456");
            this.BackColor = Color.Blue;

        }

        private void button1_Click(object sender, EventArgs e)
        {
           var uName = "admin";
         
            var pword = "123456";

            var uname = userName.Text;

            var pwd = passWord.Text;

            var kk = userName.Text;

            if (!string.IsNullOrEmpty(uName) && !string.IsNullOrEmpty(pwd) && kk == pwd)
            {
                MessageBox.Show("注册成功", "恭喜", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);
                Form1.user.Add(uName, pwd);
            }
            else
            {
                MessageBox.Show("注册失败", "很遗憾", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
            }
        }
    }
}
